This is content in the body of our card
${item ? `You want to render item ID: ${item}
` : "You didn't specify an item ID…
"}class EnvatoMarketCard extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.item = this.hasAttribute('item') ? this.getAttribute('item') : null; this.render(); } disconnectedCallback() {} render() { const { shadowRoot, item } = this; console.log(JSON.stringify(item, null, 2)); shadowRoot.innerHTML = `
This is content in the body of our card
${item ? `You want to render item ID: ${item}
` : "You didn't specify an item ID…
"}